<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class tel extends Model
{
    //关联数据表
    public $table = 'tel';

    //主键
    public $primaryKey = "id";

    //允许操作的字段
    public $fillable = ['bid','pid','orderno','status','branch','order','type','callbackUrl','goods','isok','buytime','price','time','oktime','num','chargeaccount','pushcallback','callback','callbackstatus','ext'];

    //不允许操作的字段
    public $guarded=[];

    //是否维护crated_at和updated_at字段
    public $timestamps = false;

    public function tel_exists($orderno){
        return $this->where("orderno",$orderno)->exists();
    }

    public function getOrderInfo($orderno){
        $res = $this->where("orderno",$orderno)->select("isok","oktime")->first();
        return $res;
    }

}
